#!/bin/bash

#A="alpha beta gamma delta epsilon zeta rw10 rw20 rw30 rw40 rw50 rw60 rw70 rw80 rw90 rw100 measure measure_remote"
#B="measure measure_remote"
#B=measure_remote

INIT=$1



. $INIT
cd $DIR

for i in $CLASSES $HELPERS
do
	rm -f $i.beam
	ERLCMD="erlc $ERLC_FLAGS $i.erl"
	echo "[compile] $ERLCMD"
	$ERLCMD || exit 1
	
#	erlc -I../../.. -pz ../../ebin +native $i.erl
#	erlc -I../../.. -pz ../../ebin  $i.erl
done

for i in $HELPERS
do
	ERLCMD="erl $ERL_FLAGS -noshell -s $i alltest_raw_to_file -s erlang halt"
	echo "[run] $ERLCMD"
	$ERLCMD || exit 1
	
	echo "Done"
done
